var ClubUserDataTab = Item.extend({
    UserDetailsTpye: 0,
    UserOverviewTpye: 1,

    userInfoNodeStartDate: 'dateStartNode.dateLabel',
    userInfoNodeEndDate: 'dateEndNode.dateLabel',

    _ccsFileName: res.ClubUserDataTab_json,
    _clubId: 0,
    _currentViewType: 1,
    _viewDataList: [], //用于显示的数据列表 ps:过滤后的
    _originalList: [], //原始过滤列表   ps:没有过滤的
    _tableView: null,
    _uidsStr: '-1',      //用于发送url时 使用的玩家列表

    _searchUid: null,  //搜索指定玩家
    _userDetailSort: 0,  //指定场次排序
    _titleSort: null,      //指定标题排序
    _titleSortHighToEnd: null,      //指定标题高到低排序
    _scoreArea: [-9999999, 9999999],

    _startYear: null,  //开始年
    _startMonth: null, //开始月
    _startDete: null,  //开始日

    _endYear: null,  //结束年
    _endMonth: null, //结束月
    _endDete: null,  //结束日

    _currentSelect: 0,
    _currentselectYear: null,    //日期选择的 年
    _currentselectMonth: null,   //日期选择的 月
    _currentselectday: null,     //日期选择的 日

    _isWinners: false,
    _curWanfa: '',
    _btn2wanfa:{
        0: '',
        1: '101',
        2: '301',
        3: '302'
    },

    _rankTimeType: [
        'today',     //今日榜
        'yesterday', //昨日榜单
        'week',      //本周榜
    ],
    //筛选类型
    _orderTypeArr: [
        'winnerCount', //大赢家
        'totalScore',  //积分
        'roomCount'    //局数
    ],
    _groupsData: null, //用户所在组数据 进入当前类是才刷新
    initItem: function (clubId) {
        this._clubId = clubId;
        this.initTableView();
        // this._initDropDownMenu();

        this._currentViewType = this.UserOverviewTpye;

        var today = new Date();
        this._startYear = this._endYear = today.getFullYear();
        this._startMonth = this._endMonth = today.getMonth() + 1;
        this._startDete = this._endDete = today.getDate();


        this._currentselectYear = this._endYear;
        this._currentselectMonth = this._endMonth;
        this._currentselectday = this._endDete;

        //设置按钮名称 用来区分点击的事那个时间按钮
        this._nodeList['dateStartNode.btn_date'].setName('startDate');
        this._nodeList['dateEndNode.btn_date'].setName('endDate');

        this._nodeList['userOverviewNode.leftValue'].setString('0');
        this._nodeList['userOverviewNode.rightValue'].setString('0');
        this._refreshDateView(this._nodeList['dateStartNode.dateLabel'], this._startYear, this._startMonth, this._startDete);
        this._refreshDateView(this._nodeList['dateEndNode.dateLabel'], this._endYear, this._endMonth, this._endDete);
        // this._uesrDetailsTitleStor(2);
        this._uesrOverviewTitleStor(0);
        this._refreshGroupBtnView();


        clubMsgManager.requestGroups(this._clubId);
        this._nodeList['seeGroup'].setVisible(false);
        /*
        if (ClubDataManager.getClubUidIsAdmin(this._clubId, gameData.uid)) {
            this._nodeList['userInfoNode.groupName'].setVisible(true);
            this._nodeList['seeGroup'].setVisible(false);
        } else {
            this._nodeList['userInfoNode.groupName'].setVisible(false);
        }
         */

        for (var i = 0; i < 4; i++){
            this._nodeList['Panel_wanfa.btn' + i].index = i;
        }
    },

    /**
     * 刷新分组按钮 文字显示
     * @private
     */
    _refreshGroupBtnView: function (str) {
        if (str == null) {
            str = '全部分组';
        }
        this._nodeList['seeGroup.label'].setString(str);
    },
    _clickDay:function (target) {
        var btnName = target.getName();
        if (btnName == 'btn_upday') {
            this._currentSelect ++;
        } else {
            this._currentSelect --;
        }
        var selectday = new Date(this._currentselectYear+'/'+this._currentselectMonth+'/'+this._currentselectday+' 00:00:00');
        var jiange = selectday.getTime() - 86400000* this._currentSelect;
        var newdate =  new Date(jiange);
        var maxdate =  new Date();
        var mixdate =  new Date(selectday.getTime() - 86400000* 15);
        if(newdate.getTime() > maxdate.getTime() || newdate.getTime() < mixdate){
            if (btnName == 'btn_upday') {
                this._currentSelect --;
            } else {
                this._currentSelect ++;
            }
            return ;
        }
        var newyear = newdate.getFullYear();
        var newmonth  = newdate.getMonth()+1;
        var newday  = newdate.getDate();
        this.refrendate('dateEndNode.dateLabel',newyear,newmonth,newday);
    },

    _initClickListeners: function () {
        this._clickListeners = {
            'seeGroup': '_clickSeeGroupHandler',
            'btn_search': '_clickSearchHandler',
            'btn_cancel': '_clickCancelHandler',
            'btn_help': '_clickHelpHandler',
            'searchNode.bg': '_clickInputId',
            'userInfoNode.btn_sortNode2': '_userDetailsSortHandler',
            'userInfoNode.btn_sortNode3': '_userDetailsSortHandler',
            'userInfoNode.btn_sortNode4': '_userDetailsSortHandler',

            'userOverviewNode.btn_sortNode0': '_userOverviewSortHandler',
            'userOverviewNode.btn_sortNode1': '_userOverviewSortHandler',
            'userOverviewNode.btn_sortNode2': '_userOverviewSortHandler',
            //'userOverviewNode.btn_edit': '_editScoreHandelr',
            'userOverviewNode.btn_edit': '_clickOk',
            'btn_downday': '_clickDay',
            'btn_upday': '_clickDay',
            'userOverviewNode.bg_inputLeft': '_clickSearchHandler',
            'userOverviewNode.bg_inputRight': '_clickSearchHandler',
        }
        this._clickListeners['dateStartNode.btn_date'] = '_clickDate';
        this._clickListeners['dateEndNode.btn_date'] = '_clickDate';
        for (var i = 0; i < 4; i++){
            this._clickListeners['Panel_wanfa.btn' + i] = '_changeWanfa';
        }

    },

    /**
     * 用户概况-编辑分数区间
     * @private
     */
    _editScoreHandelr: function () {
        showWindow('ClubUserEditScoreWindow');
    },

    _initEventListeners: function () {
        this._eventListeners = {};
        this._eventListeners[ClubGroupSelectEvent] = '_selectGroupHandler';
        this._eventListeners[ClubUserEditOverEvent] = '_clubEditHanlder';

        this._eventListeners[ClubMsgCode.AllMemberInfo] = '_allMemberInfoHandler';
        this._eventListeners[ClubMsgCode.QueryClubGroup] = '_queryClubGroupHandler';

        this._eventListeners[ClubRecordCode.GetReCordUserData] = '_getUserData';
    },

    /**
     * 初始化下拉菜单
     * @private
     */
    _initDropDownMenu: function () {
        var config = {
            selectBgRes: res.dropDownMenuTopBack,
            selectBtnRes: res.dropDownMenuBtn,
            menuRes: res.dropDownMenuBack1,
            dataArr: ['参与系数', '场次数据'],
            normalIndex: 1,
            fontSize: 20,
            selectCallBack: this._dropDownMenuHandler.bind(this)
        };
        this._dropDownMenu = new DropDownMenu(config);
        this.addChild(this._dropDownMenu);
        this._dropDownMenu.setPosition(this._nodeList['menu'].getPosition());
    },

    /**
     * 初始化TableView
     */
    initTableView: function () {
        var nodeContent = this._nodeList['nodeContent'];
        var tableViewSize = nodeContent.getContentSize();
        this._tableView = new cc.TableView(this, cc.size(tableViewSize.width, tableViewSize.height));
        this._tableView.setDelegate(this);
        this._tableView.setDirection(cc.SCROLLVIEW_DIRECTION_VERTICAL);
        this._tableView.setVerticalFillOrder(cc.TABLEVIEW_FILL_TOPDOWN);
        this._tableView.setPosition(nodeContent.getPosition());
        nodeContent.getParent().addChild(this._tableView);
    },

    /**
     * 下拉菜单选中的内容
     * @param content
     * @param index
     * @private
     */
    _dropDownMenuHandler: function (content, index) {
        this._currentViewType = index;
        this._changeView(index);
    },

    /**
     * 当前选中分组
     * @private
     */
    _selectGroupHandler: function (data) {
        this._uidsStr = data['type'] || data['uids'];
        //s
        if (data['type'] && data['type'] == ClubGroupBtn_All) {
            this._uidsStr = '-1';
        } else {
            this._uidsStr = data['uids'].join(',');
        }
        this._refreshGroupBtnView(data['name']);
        if (this._uidsStr.length == 0) {
            showAlert('当前分组没有玩家');
            return;
        }
        this.requestUserData();
    },

    /**
     * 刷新分组按钮 文字显示
     * @private
     */
    c: function (str) {
        if (str == null) {
            str = '全部分组';
        }
        this._nodeList['seeGroup.label'].setString(str);
    },


    _clubEditHanlder: function (data) {
        var leftValue = data['leftValue'] == 0 ? 0 : data['leftValue'];
        var rightValue = data['rightValue'] == 0 ? 0 : data['rightValue'];
        this._nodeList['userOverviewNode.leftValue'].setString(leftValue);
        this._nodeList['userOverviewNode.rightValue'].setString(rightValue);
        if (leftValue == 0 && rightValue == 0) {
            this._scoreArea = [-9999999, 9999999];
        } else {
            this._scoreArea = [parseInt(leftValue), parseInt(rightValue)];
        }

        this._dataFilter();
    },
    _synScoreInterval: function(){
        var leftValue = this._nodeList['userOverviewNode.leftValue'].getString();
        var rightValue = this._nodeList['userOverviewNode.rightValue'].getString();
        if (leftValue == '0' && rightValue == '0') {
            this._scoreArea = [-9999999, 9999999];
        } else {
            this._scoreArea = [leftValue, rightValue];
        }
    },

    /**
     * 用户详情  title上的的小排序
     * @private
     */
    _uesrDetailsTitleStor: function (type) {
        for (var i = 2; i < 5; i++) {
            var arrowVisible = i == type;
            this._nodeList['userInfoNode.btn_sortNode' + i + '.arrowUp'].setVisible(false);
            this._nodeList['userInfoNode.btn_sortNode' + i + '.arrowDown'].setVisible(false);
        }
        this._userDetailSort = type;
        this._dataFilter();
    },

    /**
     * 用户详情  title上的的小排序
     * @private
     */
    _uesrOverviewTitleStor: function (type) {
        var downScale = 1;
        if (this._titleSort == type) {
            var arrowDown = this._nodeList['userOverviewNode.btn_sortNode' + type + '.arrowDown'];
            downScale = arrowDown.getScale();
            downScale = downScale == 1 ? -1 : 1;
            arrowDown.setScale(downScale);
        } else {
            for (var i = 0; i < 3; i++) {
                var arrowVisible = i == type;
                this._nodeList['userOverviewNode.btn_sortNode' + i + '.arrowUp'].setVisible(false);
                this._nodeList['userOverviewNode.btn_sortNode' + i + '.arrowDown'].setVisible(false);
                this._nodeList['userOverviewNode.btn_sortNode' + i + '.arrowDown'].setScale(1);
            }
        }

        this._titleSort = type;
        this._titleSortHighToEnd = downScale == 1;
        this._dataFilter();
    },


    /**
     * 点击时间
     * @private
     */
    _clickDate: function (target) {
        var today = new Date();
        var curyear = today.getFullYear();
        var curmonth = today.getMonth() + 1;
        var curday = today.getDate();

        var dateLabel = 'dateStartNode.dateLabel';
        if (target.getName() == 'endDate') {
            dateLabel = 'dateEndNode.dateLabel';
            var _clubPowerDate = new ClubPowerDate(curyear, curmonth, curday, this._powerDateHandler.bind(this, dateLabel));
            window.curScene.addChild(_clubPowerDate, 99);
        } else {
            var _clubPowerDate = new ClubPowerDate(curyear, curmonth, curday, this._powerDateHandler.bind(this, dateLabel), null, null, 1);
            window.curScene.addChild(_clubPowerDate, 99);
        }
    },

    /**
     * 用户详情 小排序
     * @param target
     * @private
     */
    _userDetailsSortHandler: function (target) {
        var str = target.getName();
        str = str.charAt(str.length - 1);
        this._uesrDetailsTitleStor(str);
    },
    /**
     * 用户详情 小排序
     * @param target
     * @private
     */
    _userOverviewSortHandler: function (target) {
        var str = target.getName();
        str = str.charAt(str.length - 1);
        this._uesrOverviewTitleStor(str);
    },

    /**
     * 点击分组查看按钮
     * @private
     */
    _clickSeeGroupHandler: function () {
        showWindow('ClubGroupWindow', GroupWindowType_See, this._clubId);
    },

    /**
     * 点击 输入用户ID
     * @private
     */
    _clickInputId: function () {
        showWindow('ClubInputWindow', '请输入玩家Id', ClubInputWindowType.InputID, this._searchUidHandler.bind(this));
    },

    /**
     * 点击搜索用户按钮
     * @private
     */
    /*
    _clickSearchHandler: function () {
        this._dataFilter();
    },
     */

    /**
     * 点击取消搜索按钮
     * @private
     */
    _clickCancelHandler: function () {
        this._searchUid = '';
        this._nodeList['searchNode.tipsLabel'].setString('输入用户ID搜索');
        this._dataFilter();
    },

    /**
     * 输入 uid后确定回调
     * @param inputStr
     * @private
     */
    _searchUidHandler: function (inputStr) {
        this._searchUid = inputStr;
        if (this._searchUid == undefined || this._searchUid == "") {
            this._nodeList['searchNode.tipsLabel'].setString('输入用户ID搜索');
            return;
        }
        this._nodeList['searchNode.tipsLabel'].setString(this._searchUid);
    },

    /**
     * 数据
     * @private
     */
    _allMemberInfoHandler: function (data) {
        // if (data['result'] != 0 && data['msg']) {
        //     return;
        // }
        // ClubDataManager.clubMembersRefresh(this._clubId, data['info']['member']);
    },

    /**
     * 分组信息请求回调
     * @param data
     * @private
     */
    _queryClubGroupHandler: function (data) {
        if (data['result'] != 0 && data['msg']) {
            return;
        }
        var groups = ClubDataManager.getClubGroupsInfo(this._clubId);
        this._groupsData = {};
        for (var i = 0; i < groups.length; i++) {
            var uids = groups[i].uids;
            for (var j = 0; j < uids.length; j++) {
                this._groupsData[uids[j]] = groups[i].name;
            }
        }
        if (ClubDataManager.getClubUidIsAdmin(this._clubId, gameData.uid)) {
            var groupList = ClubDataManager.getClubGroupsInfo(this._clubId);
            for (var key in groupList) {
                var uids = groupList[key]['uids'] || [];
                if (uids.indexOf(gameData.uid) >= 0) {
                    this._nodeList['userInfoNode.groupName'].setString('组名:' + groupList[key]['name']);
                }
            }
        }
        this._tableView.reloadData();
    },

    /**
     * 点击帮助按钮
     * @private
     */
    _clickHelpHandler: function () {
        // this.addChild(new ClubHelpLayer(5));
        showWindow('ClubHelpWindow',ClubHelpWindow_Type.Coefficient);
    },

    /**
     * 时间选中回调结果
     * @private
     */
    _powerDateHandler: function (dateLabel, year, month, day) {
        this._currentSelect = 0;
        this._currentselectYear = year;
        this._currentselectMonth = month;
        this._currentselectday = day;
        this.refrendate(dateLabel, year, month, day);
    },
    refrendate:function (dateLabel, year, month, day) {
        if (dateLabel == 'dateStartNode.dateLabel') {
            this._startYear = year;
            this._startMonth = month;
            this._startDete = day;
        } else {
            this._endYear = year;
            this._endMonth = month;
            this._endDete = day;
        }
        this._refreshDateView(this._nodeList[dateLabel], year, month, day);
        this.requestUserData();
    },

    /**
     * 刷新时间显示
     * @private
     */
    _refreshDateView: function (label, year, month, day) {
        if (month < 10) {
            month = '0' + month;
        }
        if (day < 10) {
            day = '0' + day;
        }
        label.setString(year + '/' + month + '/' + day);
    },


    /**
     * 改变现实界面
     * @private
     */
    _changeView: function (type) {
        this._currentViewType = type;
        this._uidsStr = '';
        this._refreshGroupBtnView();
        this.requestUserData();
        var nodeVisible = (this._currentViewType == this.UserDetailsTpye);
        this._nodeList['userInfoNode'].setVisible(nodeVisible);
        this._nodeList['btn_help'].setVisible(nodeVisible);
        this._nodeList['userOverviewNode'].setVisible(!nodeVisible);
    },

    _changeWanfa: function(sender){
        var index = sender.index;
        if (this._curWanfa == this._btn2wanfa[index]) return;
        this._curWanfa = this._btn2wanfa[index];

        for (var i = 0; i < 4; i++){
            if (i == index){
                this._nodeList['Panel_wanfa.btn' + i + '.unselect'].setVisible(false);
            }
            else {
                this._nodeList['Panel_wanfa.btn' + i + '.unselect'].setVisible(true);
            }
        }

        this.requestUserData();
    },

    refreshView: function (isWinner) {
        this._synScoreInterval();
        //请求所有成员信息
        network.send(2103, {cmd: ClubMsgCode.AllMemberInfo, club_id: this._clubId, op: 2});
        //请求分组信息 ps:这个信息其实也可以放到ClubGroupWindow里去请求。
        network.send(2103, {cmd: ClubMsgCode.QueryClubGroup, club_id: this._clubId});
        if (isWinner != undefined && isWinner != null) {
            this._isWinners = isWinner;
        }
        else {
            this._isWinners = false;
        }

        if (this._isWinners == true){
            this._nodeList['userOverviewNode.txt_tips_01'].setVisible(false);
            this._nodeList['userOverviewNode.txt_tips_02'].setVisible(false);
            this._nodeList['userOverviewNode.txt_tips_02_0'].setVisible(true);
        }
        else {
            this._nodeList['userOverviewNode.txt_tips_01'].setVisible(true);
            this._nodeList['userOverviewNode.txt_tips_02'].setVisible(true);
            this._nodeList['userOverviewNode.txt_tips_02_0'].setVisible(false);
        }
        this._changeView(this._currentViewType);
    },

    formatStr: function (num) {
        if (num.length < 2 || num < 10) {
            return '0' + num;
        }
        return num;
    },

    requestHttp: function () {
        showLoading('加载中...');
        var sendUid = '-99';
        var startmMonth = this.formatStr(this._startMonth);
        var endMonth = this.formatStr(this._endMonth);
        var startmDay = this.formatStr(this._startDete);
        var endDay = this.formatStr(this._endDete);
        var sendData = {
            area: app.area,
            groupId: (this._clubId + '@club'),
            startDate: this._endYear + '-' + endMonth + '-' + endDay,
            endDate: this._endYear + '-' + endMonth + '-' + endDay,
            sign: Crypto.MD5('fy-club-stat' + app.area + this._clubId + '@club' + sendUid),
        };
        sendData['playerId'] = sendUid;
        if (this._uidsStr != '-1') {
            sendData['players'] = this._uidsStr;
        } else {

        }
        cc.log('请求数据:' + JSON.stringify(sendData));

        var cmd = '/club/stat/getDataByGroupList2';
        if (this._currentViewType == this.UserOverviewTpye) {
            cmd = '/club/stat/getRankingsList2';
        }
        cc.log('url' + (club.clubFyClubApiUrl + cmd));
        http.post(club.clubFyClubApiUrl + cmd, sendData, this._requestHandler.bind(this), null, true);
    },
    _requestHandler: function (data) {
        hideLoading();
        this._originalList = data;

        if (this._currentViewType == this.UserDetailsTpye) {
            var currentGoup = this._nodeList['seeGroup.label'].getString();
            var totalCoe = 0.0;
            for (var idx = 0; idx < this._originalList.length; idx++) {
                var info = this._originalList[idx];
                var player2Num = info.roomCount2;
                var player3Num = info.roomCount3;
                var player4Num = info.roomCount4;
                var allCoe = 1 / 2 * player2Num + 1 / 3 * player3Num + 1 / 4 * player4Num;
                totalCoe += allCoe;
            }
            if (currentGoup == '全部分组') {
                this._nodeList['userInfoNode.groupModulus'].setVisible(false);
                this._nodeList['userInfoNode.totalModulus'].setString('总系数：' + totalCoe.toFixed(3));
            } else {
                this._nodeList['userInfoNode.groupModulus'].setVisible(true);
                this._nodeList['userInfoNode.groupModulus'].setString('组系数：' + totalCoe.toFixed(3));
            }
        }
        this._dataFilter();

        if (ClubDataManager.getClubUidIsAdmin(this._clubId, gameData.uid)) {
            var totalCoe = 0;
            for (var idx = 0; idx < this._viewDataList.length; idx++) {
                var info = this._viewDataList[idx];
                var player2Num = info.roomCount2;
                var player3Num = info.roomCount3;
                var player4Num = info.roomCount4;
                var allCoe = 1 / 2 * player2Num + 1 / 3 * player3Num + 1 / 4 * player4Num;
                totalCoe += allCoe;
            }
            this._nodeList['userInfoNode.groupModulus'].setVisible(true);
            this._nodeList['userInfoNode.groupModulus'].setString('组系数：' + totalCoe.toFixed(3));
        }
    },

    tableCellAtIndex: function (table, idx) {
        var cell = table.dequeueCell();
        var node = null;
        var isUesrDetailsTpye = (this._currentViewType == this.UserDetailsTpye);
        var groupName = '';
        if (this._viewDataList[idx] && this._viewDataList[idx]['playerId'] && this._groupsData && this._groupsData[this._viewDataList[idx]['playerId']]) {
            groupName = this._groupsData[this._viewDataList[idx]['playerId']];
        }
        if (cell == null) {
            cell = new cc.TableViewCell();
            node = addItem('ClubUserItem', cell, this._viewDataList[idx], this._clubId, groupName, isUesrDetailsTpye, this._isWinners);
            node.setName("itemCell");
        } else {
            node = cell.getChildByName("itemCell");
            node.setData(this._viewDataList[idx], this._clubId, groupName, isUesrDetailsTpye, this._isWinners);
        }
        return cell;
    },
    tableCellTouched: function (table, cell) {
    },
    tableCellSizeForIndex: function (table, idx) {
        return cc.size(955, 56);
    },
    numberOfCellsInTableView: function (table) {
        return this._viewDataList.length;
    },


    /**
     * 数据过滤
     * @private
     */
    _dataFilter: function () {
        var dataList = this._originalList || [];
        /*
        if (this._searchUid && this._searchUid.length > 0) {
            var tempList = [];
            for (var i = 0; i < dataList.length; i++) {
                var temp = dataList[i];
                if (this._searchUid == temp['playerId']) {
                    tempList.push(temp);
                }
            }
            dataList = tempList;
        }
        //在用户详情中 才有这个过滤
        if (this._currentViewType == this.UserDetailsTpye && this._userDetailSort != null) {
            var str = 'roomCount' + this._userDetailSort;
            dataList = dataList.sort(function (a, b) {
                if (a[str] > b[str]) {
                    return -1;
                } else {
                    return 1;
                }
            });
        }
        if (this._currentViewType == this.UserOverviewTpye && this._titleSort != null) {
            var str = 'winnerCount';
            if (this._titleSort == 1) {
                str = 'totalScore';
            } else if (this._titleSort == 2) {
                str = 'roomCount';
            }

            dataList = dataList.sort(function (a, b) {
                if (a[str] > b[str]) {
                    return this._titleSortHighToEnd ? -1 : 1;
                } else {
                    return this._titleSortHighToEnd ? 1 : -1;
                }
            }.bind(this));

        }
        */
        if (this._currentViewType == this.UserOverviewTpye) {
            var tempList = [];
            for (var i = 0; i < dataList.length; i++) {
                var temp = dataList[i]['winnerScore'];
                if (temp >= this._scoreArea[0] && temp <= this._scoreArea[1]) {
                    tempList.push(dataList[i]);
                }
            }
            dataList = tempList;
        }
        /*
        if (ClubDataManager.getClubUidIsAdmin(this._clubId, gameData.uid)) {
            var tempList = [];
            var groupList = ClubDataManager.getClubGroupsInfo(this._clubId);
            var groupUids = [];
            for (var key in groupList) {
                var uids = groupList[key]['uids'] || [];
                if (uids.indexOf(gameData.uid) >= 0) {
                    groupUids = uids;
                    break;
                }
            }
            for (var i = 0; i < dataList.length; i++) {
                var temp = dataList[i];
                if (groupUids.indexOf(temp['playerId']) >= 0) {
                    tempList.push(temp);
                }
            }
            dataList = tempList;
        }
         */
        this._viewDataList = dataList;
        this._tableView.reloadData();
    },

    _refreshModulus: function (totle, group) {
        this._nodeList['userInfoNode.groupModulus'].setString('总系数：' + totle.toFixed(3));
    },
    requestUserData: function () {
        network.send(40001, {
            cmd: ClubRecordCode.GetReCordUserData,
            area: app.area,
            clubId: this._clubId,
            //mapids: ClubDataManager.getAllAppWanfaMapIdStr(),
            mapids: this._curWanfa == '' ? ClubDataManager.getAllAppWanfaMapIdStr() : this._curWanfa,
            timeType: this._rankTimeType[0],
            startDate: this._nodeList['dateEndNode.dateLabel'].getString().replace(/\//g, '-'),
            endDate: this._nodeList['dateEndNode.dateLabel'].getString().replace(/\//g, '-'),
            orderByType: this._orderTypeArr[1],
        });
    },
    _getUserData: function (data) {
        this._requestHandler(data);
    },
    _clickSearchHandler: function (target) {
        var clubEditScore = new ClubEditScore(this._editPanelCallBack.bind(this, target.getName()));
        this.addChild(clubEditScore);
        clubEditScore.setPositionX(clubEditScore.getPositionX() - (DesignSize.width - 1016) / 2);
    },
    _editPanelCallBack: function (inputName, str) {
        if (inputName == 'bg_inputLeft') {
            this._nodeList['userOverviewNode.leftValue'].setString(str);
        } else {
            this._nodeList['userOverviewNode.rightValue'].setString(str);
        }
    },

    _clickOk: function () {
        var leftValue = parseInt(this._nodeList['userOverviewNode.leftValue'].getString());
        var rightValue = parseInt(this._nodeList['userOverviewNode.rightValue'].getString());
        if (rightValue != 0 && leftValue > rightValue) {
            showAlert('左侧数值不能大于右侧数值!');
            return;
        }
        eventManager.dispatchEvent(ClubUserEditOverEvent, {leftValue: leftValue, rightValue: rightValue});
    },
});